control
Class Orchestrator

java.lang.Object
  extended by control.Orchestrator

public class Orchestrator
extends java.lang.Object

This Class permits to generate the Orchestrator and obtain its result


Field Summary
private  Community community
           
private  java.util.Map<OrchestratorKey,java.util.Set<Service>> orchestrator
           
private  Simulation s
           
private  Service target
           
 
Constructor Summary
Orchestrator(Community community, Service target)
           
 
Method Summary
 boolean checkComposition()
          checks if composition exists, that is if the initial states of target and available services are in the simulation set
private  boolean contains(java.util.Set<Service> sts, Service s)
          checks if a service is already present in a set of service
 Service createOrchestratorGenerator()
          creates a graph representing the Orchestrator Generator obtained from this orchestrator
 boolean generateOrchestrator()
          creates the orchestrator generator storing the result in a map with: key = a target state, a community state and an action for which they are in simulation value = a set of services which are able to perform this simulation between states and for an action indicates in the key
 java.util.Iterator<java.util.Map.Entry<OrchestratorKey,java.util.Set<Service>>> getOrchestrator()
          gets an iterator on the element of the map produced by the orchestrator generator
 java.util.Iterator<Service> getServicesForStateAction(OrchestratorKey orch)
          gets the set of services which are able to perform a simulation between a target state and a community state with an action
 java.util.Iterator<SimulatedBy> getSimulationSet()
          gets an iterator on the simulation set
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s

private Simulation s

community

private Community community

target

private Service target

orchestrator

private java.util.Map<OrchestratorKey,java.util.Set<Service>> orchestrator
Constructor Detail

Orchestrator

public Orchestrator(Community community,
                    Service target)
Method Detail

generateOrchestrator

public boolean generateOrchestrator()
creates the orchestrator generator storing the result in a map with: key = a target state, a community state and an action for which they are in simulation value = a set of services which are able to perform this simulation between states and for an action indicates in the key

Returns:
false if orchestrator and simulation set are empty, true otherwise

checkComposition

public boolean checkComposition()
checks if composition exists, that is if the initial states of target and available services are in the simulation set

Returns:
true if composition exits, otherwise false

contains

private boolean contains(java.util.Set<Service> sts,
                         Service s)
checks if a service is already present in a set of service

Parameters:
sts - - set of services
s - - service
Returns:
true if the set contains the specified service

getOrchestrator

public java.util.Iterator<java.util.Map.Entry<OrchestratorKey,java.util.Set<Service>>> getOrchestrator()
gets an iterator on the element of the map produced by the orchestrator generator

Returns:
an iterator

getServicesForStateAction

public java.util.Iterator<Service> getServicesForStateAction(OrchestratorKey orch)
gets the set of services which are able to perform a simulation between a target state and a community state with an action

Parameters:
orch - - an object OrchestratorKey containing a target state, a community state and an action to check
Returns:
an iterator on a set of services

getSimulationSet

public java.util.Iterator<SimulatedBy> getSimulationSet()
gets an iterator on the simulation set

Returns:
Iterator on SymulatedBy elements

createOrchestratorGenerator

public Service createOrchestratorGenerator()
creates a graph representing the Orchestrator Generator obtained from this orchestrator

Returns:
a service that is the OG

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object